<#import "/global.ftl" as menu_edit />
<form id="menuEditForm" method="post">
    <table>
        <tr>
            <td><label for="parentId">parentId:</label></td>
            <td>
                <select id="parentId" class="easyui-combotree" name="sysMenu.parentId" style="width:200px;"
                        data-options="url:'<@menu_edit.basePath/>/sys/menu/parentMenu',required:true,value:'${sysMenu.parentId}'">
                </select>
            </td>
        </tr>
        <tr>
            <td><label for="menuType">menuType:</label></td>
            <td>
                <select id="menuType" class="easyui-combobox"  name="sysMenu.menuType"
                        data-options="required:true,value:'${sysMenu.menuType}'">
                    <option value="0">操作</option>
                    <option value="1">菜单</option>
                    <option value="2">功能</option>
                    <option value="3">子功能</option>
                </select>
            </td>
        </tr>
        <tr>
            <td><label for="menuCode">menuCode:</label></td>
            <td><input class="easyui-validatebox" type="text" id="menuCode" name="sysMenu.menuCode"
                   data-options="required:true" value="${sysMenu.menuCode}"/></td>
        </tr>
        <tr>
            <td><label for="menuName">menuName:</label></td>
            <td><input class="easyui-validatebox" type="text" id="menuName" name="sysMenu.menuName"
                   data-options="required:true" value="${sysMenu.menuName}"/></td>
        </tr>
        <tr>
            <td><label for="sort">sort:</label></td>
            <td><input class="easyui-validatebox" type="text" id="sort" name="sysMenu.sort"
                   data-options="required:true" value="${sysMenu.sort}" /></td>
        </tr>
        <tr>
            <td><label for="href">href:</label></td>
            <td><input class="easyui-validatebox" type="text" id="href" name="sysMenu.href"
                   data-options="required:true" value="${sysMenu.href}" /></td>
        </tr>
        <tr>
            <td><label for="icon">icon:</label></td>
            <td><input class="easyui-validatebox" type="text" id="icon" name="sysMenu.icon"
                   data-options="required:true" value="${sysMenu.icon}"/></td>
        </tr>
        <tr>
            <td><label for="status">status:</label></td>
            <td>
                <input id="statusYes" type="radio" name="sysMenu.status" checked value="1">启用</input>
                <input id="statusNo"  type="radio" name="sysMenu.status" value="0" >禁用</input>
            </td>
        </tr>
        <tr>
            <td><label for="permission">permission:</label></td>
            <td><input class="easyui-validatebox" type="text" id="permission" name="sysMenu.permission"
                   data-options="required:true" value="${sysMenu.permission}"/></td>
        </tr>
        <tr>
            <td><label for="remarks">remarks:</label></td>
            <td>
                <input class="easyui-validatebox" type="text" id="remarks" name="sysMenu.remarks" value="${sysMenu.remarks}"/>
            </td>
        </tr>
    </table>
    <input type="hidden" name="pageType" value="${pageType}" />
    <input type="hidden" name="sysMenu.menuId" value="${sysMenu.menuId}" />
</form>
<script type="text/javascript">
    function menuEditSubmit(){
        $.post('<@menu_edit.basePath/>/sys/menu/save',
            $("#menuEditForm").serialize(),
            function(data){
                if(true==data.success){
                    $("#menuTables").datagrid('reload');
                    $('#addMenuDiv').dialog('close');
                } else {
                    $.messager.alert('error',data.message);
                }
            });
    }

</script>

